//
//  ZFAQsTableViewCell.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/21.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZFAQsTableViewCell.h"

@implementation ZFAQsTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initlizeInterface];
    }
    return self;
}
- (void)setFModel:(ZDoctorHModel *)fModel {
    _fModel = fModel;
    _contextLabel.text = fModel.title;
    _userView.model = fModel.model;
}
- (void)initlizeInterface {
    [self makeAllSubView];
    [self addAllSubView];
    [self makeAllSubViewMasnoy];
}
- (void)makeAllSubView {
    self.contextLabel = [[UILabel alloc] init];
    self.contextLabel.textColor = [UIColor blackColor];
    self.contextLabel.numberOfLines = 3;
    self.contextLabel.font = [UIFont systemFontOfSize:16];
    self.userView = [[ZConsumerView alloc] init];
    self.garyView = [[UIView alloc] init];
    self.garyView.backgroundColor = MYGRAYCOLOR;
}
- (void)addAllSubView {
    [self.contentView addSubview:self.contextLabel];
    [self.contentView addSubview:self.userView];
    [self.contentView addSubview:self.garyView];
}
- (void)makeAllSubViewMasnoy {
    [self.contextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(10*xsIZE);
        make.right.equalTo(self.contentView).offset(10*xsIZE);
        make.height.offset(60*ysIZE);
        make.top.equalTo(self.contentView).offset(20*ysIZE);
    }];
    [self.userView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(self.contentView);
        make.left.equalTo(self.contentView);
        make.height.offset(30*ysIZE);
        make.bottom.equalTo(self.garyView.mas_top).offset(-5*ysIZE);
    }];
    [self.garyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.left.equalTo(self.contentView);
        make.height.offset(10*ysIZE);
        make.bottom.equalTo(self.contentView);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
